//-----------------------------------------------------------------------
//  This file is part of the Microsoft Code Samples.
// 
//  Copyright (C) Microsoft Corporation.  All rights reserved.
// 
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
// 
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//-----------------------------------------------------------------------

using System;

namespace Microsoft.Samples.SqlServer
{
	/// <summary>tion for Constants.
	/// </summary>
	/// Summary descrip
	public class Constants
	{
		#region Constant Declarations

		// Constants for XML name spaces
		public const string XmlOrderingRequestNamespace = "http://schemas.adventure-works.com/demo/OrderingRequest";
		public const string XmlOrderingResponseNamespace = "http://schemas.adventure-works.com/demo/OrderingResponse";
		public const string XmlPurchasingRequestNamespace = "http://schemas.adventure-works.com/demo/PurchasingRequest";
		public const string XmlPurchasingApproveNamespace = "http://schemas.adventure-works.com/demo/PurchasingApprove";
		public const string XmlPurchasingAcceptNamespace = "http://schemas.adventure-works.com/demo/PurchasingAccept";
		public const string XmlPurchasingDeliveryNamespace = "http://schemas.adventure-works.com/demo/PurchasingDelivery";
		public const string XmlManufacturingRequestNamespace = "http://schemas.adventure-works.com/demo/ManufacturingRequest";
		public const string XmlManufacturingAcceptNamespace = "http://schemas.adventure-works.com/demo/ManufacturingAccept";
		public const string XmlManufacturingDeliveryNamespace = "http://schemas.adventure-works.com/demo/ManufacturingDelivery";
		public const string XmlShippingRequestNamespace = "http://schemas.adventure-works.com/demo/ShippingRequest";
		public const string XmlShippingResponseNamespace = "http://schemas.adventure-works.com/demo/ShippingResponse";
		public const string XmlNamespacePrefix = "";

		// Root elements
		public const string XmlOrderingRequestRoot = "OrderingRequest";
		public const string XmlPurchasingRequestRoot = "PurchasingRequest";
		public const string XmlManufacturingRequestRoot = "ManufacturingRequest";
		public const string XmlShippingRequestRoot = "ShippingRequest";

		public const string XmlSalesOrderID = "SalesOrderID";
		public const string XmlCustomerID = "CustomerID";
		public const string XmlBillToAddressID = "BillToAddressID";
		public const string XmlShipToAddressID = "ShipToAddressID";
		public const string XmlSubtotal = "SubTotal";
		public const string XmlTaxAmount = "TaxAmount";
		public const string XmlTotalDue = "TotalDue";
		public const string XmlOrderDate = "OrderDate";
		public const string XmlLineItem = "LineItem";
		public const string XmlLineNumber = "linenumber";
		public const string XmlProductID = "productID";
		public const string XmlQuantity = "quantity";
		public const string XmlLineTotal = "linetotal";
		public const string XmlTimeStamp = "TimeStamp";
		public const string XmlVendorID = "VendorID";
		public const string XmlProductDetail = "ProductDetail";
		public const string XmlCustomer = "Customer";
		public const string XmlComment = "Comment";
		public const string XmlFirstName = "fname";
		public const string XmlLastName = "lname";
		public const string XmlAddress1 = "addressl1";
		public const string XmlAddress2 = "addressl2";
		public const string XmlCity = "city";
		public const string XmlState = "state";
		public const string XmlCountry = "country";
		public const string XmlZip = "zip";
		public const string XmlTelephone = "telephone";
		public const string XmlShipStatus = "ShipStatus";
		public const string XmlEstimatedShipDate = "EstShipDate";
		public const string XmlPurchaseOrderID = "PurchaseOrderID";
		public const string XmlStatus = "Status";

		// Constants for message types
		public const string OrderingRequestMessageType =	"//www.AdventureWorks.com/msg/OrderingRequest";
		
		public const string PurchasingRequestMessageType = "//www.AdventureWorks.com/msg/PurchasingRequest";
		public const string PurchasingApproveMessageType = "//www.AdventureWorks.com/msg/PurchasingApprove";
		public const string PurchasingAcceptMessageType = "//www.AdventureWorks.com/msg/PurchasingAccept";
		public const string PurchasingDeliveryMessageType = "//www.AdventureWorks.com/msg/PurchasingDelivery";

		public const string ManufacturingRequestMessageType = "//www.AdventureWorks.com/msg/ManufacturingRequest";
		public const string ManufacturingAcceptMessageType = "//www.AdventureWorks.com/msg/ManufacturingAccept";
		public const string ManufacturingDeliveryMessageType = "//www.AdventureWorks.com/msg/ManufacturingDelivery";

		public const string ShippingRequestMessageType = "//www.AdventureWorks.com/msg/ShippingRequest";
		public const string ShippingAcceptMessageType = "//www.AdventureWorks.com/msg/ShippingAccept";
		
		// Constants for shipping status
		public const string StatusShipped = "Shipped";
		public const string StatusUnshippable = "Unshippable";

		// Constants for purchasing approval status
		public const string StatusApproved = "Approved";
		public const string StatusRejected = "Rejected";

		// Constants for system message types
		public const string EndDialogMessageType = "http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog";
		public const string ErrorMessageType = "http://schemas.microsoft.com/SQL/ServiceBroker/Error";
	

		// Constants for contracts
		public const string OrderingContract = "//www.AdventureWorks.com/contract/Ordering/v1.0";
		public const string PurchasingContract = "//www.AdventureWorks.com/contract/Purchasing/v1.0";
		public const string ManufacturingContract = "//www.AdventureWorks.com/contract/Manufacturing/v1.0";	
		public const string ShippingContract = "//www.AdventureWorks.com/contract/Shipping/v1.0";

		// Constants for queue names
		public const string StorefrontQueue = "StorefrontQueue";
		public const string OrderingQueue = "OrderingQueue";
		public const string PurchasingQueue = "PurchasingQueue";
		public const string ManufacturingQueue = "ManufacturingQueue";
		public const string ShippingQueue = "ShippingQueue";
		
		// Constants for service names
		public const string StorefrontService = "Storefront";
		public const string OrderingService = "Ordering";
		public const string PurchasingService = "Purchasing";
		public const string ManufacturingService = "Manufacturing";
		public const string ShippingService = "Shipping";

		// Connection String
		// This string works for integrated authentication
	    public const string ConnectionString = "server=localhost;database=AdventureWorks;Integrated Security=SSPI";
		
		// This string works for sql server authentication
		// Broker Timeout Settings
		public const string ReceiveTimeout = "6000";
		public const string DialogTimeout = "10000";
		public const string GetConversationGroupTimeout = "6000";

		public enum Type
		{
			Purchasing,
			Manufacturing,
			Shipping
		}

		// Constants for status of the order. 
		public enum Status 
		{
			PendingInventoryCheck  = 0, // just sent ordering request message	
			PendingPurchasingApproval = 1, // just sent the purchasing request message
			PendingPurchasingAccept = 2, // just received the purchasing approval message
			PendingPurchasingDelivery = 3, // just received all the purchasing accept message
			PendingManufacturingAccept = 4, // the item is out of stock but the subcomponents are in stock. Either PendingManufacturingAccept or PendingInventoryCheck or PendingPurchasingDelivery	could come before this state.
			PendingManufacturingDelivery = 5, // just received all the manufacturing accept message
			PendingShippingAccept = 6, 			// just sent the shipping request message. Either PendingManufacturingDelivery or PendingPurchasingDelivery could come before this state.
			Shipped =7 // received the shipping accept message (shipped)
		}
		#endregion
	}
}
